package com.kifas.entity;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author brainmaster
 * 
 */
@Entity
@Table(name = "tb_detail_pembelian")
public class PembelianDetailEntity implements Serializable {

	private static final long serialVersionUID = 7870586686747341885L;

	@Id
	@GeneratedValue
	@Column(name = "id_detail_pembelian")
	private Long idDetailPembelian;

	@ManyToOne
	@JoinColumn(name = "id_pembelian", nullable = false)
	private PembelianEntity pembelian;

	@ManyToOne
	@JoinColumn(name = "id_barang", nullable = false)
	private BarangEntity barang;

	private Integer qty;

	private BigDecimal discount;

	private BigDecimal pajak;

	private BigDecimal price;

	private BigDecimal subTotal;
	
	@Column(name= "created_by")
	private String createdBy;

	public PembelianDetailEntity() {
	}
	
	public PembelianDetailEntity(Long idDetailPembelian, PembelianEntity pembelian, BarangEntity barang, Integer qty, BigDecimal discount, BigDecimal pajak,
			BigDecimal price, BigDecimal subTotal, String createdBy) {
		this.idDetailPembelian = idDetailPembelian;
		this.pembelian = pembelian;
		this.barang = barang;
		this.qty = qty;
		this.discount = discount;
		this.pajak = pajak;
		this.price = price;
		this.subTotal = subTotal;
		this.createdBy = createdBy;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public BigDecimal getSubTotal() {
		return subTotal;
	}

	public void setSubTotal(BigDecimal subTotal) {
		this.subTotal = subTotal;
	}

	public Long getIdDetailPembelian() {
		return idDetailPembelian;
	}

	public void setIdDetailPembelian(Long idDetailPembelian) {
		this.idDetailPembelian = idDetailPembelian;
	}

	public PembelianEntity getPembelian() {
		return pembelian;
	}

	public void setPembelian(PembelianEntity pembelian) {
		this.pembelian = pembelian;
	}

	public BarangEntity getBarang() {
		return barang;
	}

	public void setBarang(BarangEntity barang) {
		this.barang = barang;
	}

	public Integer getQty() {
		return qty;
	}

	public void setQty(Integer qty) {
		this.qty = qty;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public BigDecimal getPajak() {
		return pajak;
	}

	public void setPajak(BigDecimal pajak) {
		this.pajak = pajak;
	}



	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}



	public String getCreatedBy() {
		return createdBy;
	}

}
